package ModelLayer;

import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class OrderTester.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class OrderTester
{
    /**
     * Default constructor for test class OrderTester
     */
    public OrderTester()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    @Test
    public void createOrder()
    {
        PersonContainer personContainer = ModelLayer.PersonContainer.getInstance();
        OrderContainer orderContainer = ModelLayer.OrderContainer.getInstance();
        ModelLayer.Customer customer1 = new ModelLayer.Customer("Hans Olesen", "12992109", "Himmelvej", "Aalborg", "9000", 3);
        ModelLayer.Employee employee1 = new ModelLayer.Employee("Ole Svenson", "9129190", "Finlandvej", "Aalborg", "9000", "OleSej", "1234", 24199, "Saelger");
        personContainer.addEmployee(employee1);
        personContainer.addCustomer(customer1);
        ModelLayer.Order order1 = new ModelLayer.Order(5, employee1, customer1);
    }

    @Test
    public void addToOrder()
    {
        PersonContainer personContainer = ModelLayer.PersonContainer.getInstance();
        ItemContainer itemContainer = ModelLayer.ItemContainer.getInstance();
        OrderContainer orderContainer = ModelLayer.OrderContainer.getInstance();
        ModelLayer.Customer customer1 = new ModelLayer.Customer("Hans Olesen", "12992109", "Himmelvej", "Aalborg", "9000", 3);
        ModelLayer.Employee employee1 = new ModelLayer.Employee("Ole Svenson", "9129190", "Finlandvej", "Aalborg", "9000", "OleSej", "1234", 24199, "Saelger");
        ModelLayer.Item item1 = new ModelLayer.Item("1234", "skovl mark 2", "fin skovl", 99.95, 49.95, "23A", 5, 10, 30, 15);
        itemContainer.addItem(item1);
        personContainer.addEmployee(employee1);
        personContainer.addCustomer(customer1);
        ModelLayer.Order order1 = new ModelLayer.Order(5, employee1, customer1);
        ModelLayer.PartOrder partOrder1 = new ModelLayer.PartOrder(item1, 10, 5);
    }

    @Test
    public void downSizeInventory()
    {
        ItemContainer itemContainer = ModelLayer.ItemContainer.getInstance();
        ModelLayer.Item item1 = new ModelLayer.Item("1234", "skovl mark 2", "fin skovl", 99.95, 49.95, "23A", 5, 10, 30, 15);
        itemContainer.addItem(item1);
        ModelLayer.PartOrder partOrder1 = new ModelLayer.PartOrder(item1, 10, 5);
        partOrder1.downsizeInventory();
    }
}

